<%@ page contentType="text/html; charset=utf-8"%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> 

<script>
function addNeroHate() {
	document.forms['neroHate'].action = "add.do";
	document.forms['neroHate'].submit();
}
function deleteNeroHate() {
	document.forms['neroHate'].action = "delete.do";
	document.forms['neroHate'].submit();
}
</script>

<form:form method="POST" action="save.do" commandName="neroHate">
<table border="1">
	<tr>
		<th></th>
		<th>Currency Code</th>
		<th>Date</th>
		<th>End Of Month Avg</th>
		<th>Average Rate</th>
		<th>Updated By</th>
		<th>Updated Date</th>
	</tr>
<c:forEach var="neroHate" items="${neroHate.neroHates}" varStatus="neroHateStat">
	<tr>
		<td>
			<form:checkbox path="neroRates[${neroRateStat.index}].deleteFlag" />
		</td>
		<td>${neroHate.currencyCode}
			<form:hidden path="neroHates[${neroHateStat.index}].currencyCode" /></td>
		<td><form:input path="neroHates[${neroHateStat.index}].effectiveDate" /></td>
		<td><form:input path="neroHates[${neroHateStat.index}].endOfMonthAvg" /></td>
		<td><form:input path="neroHates[${neroHateStat.index}].averageRate" /></td>
		<td>${neroHate.updatedBy}
			<form:hidden path="neroHates[${neroHateStat.index}].updatedBy" /></td>
		<td><form:input path="neroHates[${neroHateStat.index}].updatedDate" /></td>
	</tr>
</c:forEach>
</table>
<form:button value="submit">Submit</form:button>
<input type="button" onclick="addNeroHate()" value="Add"/>
<input type="button" onclick="deleteNeroHate()" value="Delete"/>
</form:form>